package `return`

class ApplyReturnTest {
    var name = ""

    override fun toString(): String = "ApplyReturnTest$${hashCode()} name = $name"
}

var test0: ApplyReturnTest? = null


fun main() {
    var flag = false
    test(flag)

    println("test0 = $test0")
}

fun test(flag: Boolean) {
    test0 = ApplyReturnTest().apply {
        if (flag) {
            name = "2233"
            return
        }

        name = "哔哩哔哩"
    }
}